<template>
  <h1>日期时间选择器</h1>
  <el-date-picker
      type="date"
      v-model="rq"
      format="YYYY-MM-DD"
      value-format="YYY-MM-DD"
      @change="console.log(rq)"
  >
  </el-date-picker>
  <br>
  <hr>

  <el-date-picker
      type="datetimerange"
      v-model="times"
      start-placeholder="开始了"
      end-placeholder="结束了"
      range-separator="到"
      format="YYYY-MM-DD HH:mm:ss"
      value-format="YYY-MM-DD  HH:mm:ss"
      @change="console.log(times)"
  >
  </el-date-picker>
</template>
<script setup>
import {ref} from "vue";

const rq = ref('');
// 注意：此处要设置为数组！因为开始时间与结束时间是两个值！
const times = ref([]);
</script>


<style scoped>

</style>